Coverity ID:
1055290
Calling LIBXL__LOG_ERRNO(ctx,) with a ctx pointer we have just failed to
allocate is going to end badly. Opencode a suitable use of xtl_log() instead.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
CC: Ian Campbell <Ian.Campbell@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
ctx = malloc(sizeof(*ctx));
if (!ctx) {
- LIBXL__LOG_ERRNO(ctx, LIBXL__LOG_ERROR, "Failed to allocate context\n");
+ xtl_log(lg, XTL_ERROR, errno, "libxl",
+ "%s:%d:%s: Failed to allocate context\n",
+ __FILE__, __LINE__, __func__);
rc = ERROR_NOMEM; goto out;
}